# Reverse Polish Notation

'''
expression = input().split(' ')

num = []

ope = []

for cha in expression:
    match cha:
        case '+' | '-' | '*' | '/' :
            ope.append(cha)
        case _:
            num.append(cha)

x = float(num.pop(0))

for op in ope:
    match op:
        case '+':
            x += float(num.pop(0))
        case '-':
            x -= float(num.pop(0))
        case '*':
            x *= float(num.pop(0))
        case '/':
            x /= float(num.pop(0))

print(x)
'''
# 没有考虑对运算顺序

##########################################################################

# mamashengde

expression = input().split(' ')

# 先定义运算函数

def caculate(a, b, op):
    match op:
        case '+':
            return a + b
        case '-':
            return a - b
        case '*':
            return a * b
        case '/':
            return a / b

value = [] #数值应该用栈存储

for op in expression:
    if op in ['+', '-', '*', '/']:
        b = value.pop()
        a = value.pop()
        value.append(caculate(a, b, op))
    else:
        value.append(float(op))

print(value[0])